package com.gack.helper.rabbtit;
import java.util.Date;

import org.springframework.amqp.core.AmqpTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class HelloSender {

    @Autowired
    private AmqpTemplate rabbitTemplate;

//    public void send() {
////        String context = "hello " + new Date();
////        System.out.println("Sender : " + context);
//    	Long time = System.currentTimeMillis();
//    	System.out.println("开始：" + time);
//        this.rabbitTemplate.convertAndSend("hello",time,message -> { // 设置延迟毫秒值
//            message.getMessageProperties().setExpiration(String.valueOf("10000"));
//            return message;
//        });
//    }

}